<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/main.c 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">main.c</div></div>
</div><!--header-->
<div class="contents">
<a href="main_8c.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#include &lt;stdbool.h&gt;</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span><span class="preprocessor">#include &quot;SWM341.h&quot;</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="preprocessor">#include &quot;<a class="code" href="version_8h.html">version.h</a>&quot;</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="preprocessor">#include &quot;<a class="code" href="bsp__init_8h.html">bsp_init.h</a>&quot;</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span><span class="preprocessor">#include &quot;lvgl.h&quot;</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="preprocessor">#include &quot;<a class="code" href="log_8h.html">log.h</a>&quot;</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span><span class="comment"> * Private Define</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="main_8c.html#a5c281603f24ccb7c38f4b2155b02cad5">   44</a></span><span class="preprocessor">#define WDT_ENABLE              0 </span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="main_8c.html#a9b93883d131a46069e13f86b3634e6a9">   45</a></span><span class="preprocessor">#define SLEEP_ENABLE            0 </span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span><span class="preprocessor">#if (SLEEP_ENABLE != 0)</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span><span class="preprocessor">    #include &quot;<a class="code" href="power__manager_8h.html">power_manager.h</a>&quot;</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span><span class="preprocessor">    #define SLEEP_TIME_MS           (30 * 1000)</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span><span class="comment"> * Public Variable</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="main_8c.html#a7d9f2d02fb8222f2a32fc7eeeed8e655">   56</a></span><span class="keyword">volatile</span> uint32_t <a class="code hl_variable" href="main_8c.html#a7d9f2d02fb8222f2a32fc7eeeed8e655">Systick_Ms_TP</a> = 0;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span><span class="comment"> * Private Prototype</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="main_8c.html#a001e0ff5f04ad4f86670205d3905c0c5">gui_init</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102">user_app</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span><span class="comment"> * Public Function</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe">   70</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>{</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>    <span class="comment">/* 在调测阶段(版本 Release 时可注释), 预防程序跑飞后, 上电无法读取 MCU 内核, 也可用作等待个别硬件模块上电稳定 */</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; 666666 * 88; ++i) __NOP();</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span> </div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span><span class="preprocessor">#if (__TARGET_CONST__ == 0xFF)</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span><span class="preprocessor">#include &quot;<a class="code" href="userboot_8h.html">userboot.h</a>&quot;</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>    <a class="code hl_function" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559">userboot</a>();</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>    </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span><span class="comment">/* 该 #else 不可去掉, 以便 UserBoot 下不将其他功能加入编译, 否则代码量将急剧增加至 百 KB 级(GUI层依赖项过多), </span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span><span class="comment"> * 如此可大大缩减代码量 (须勾选 One ELF Section per Funciton)</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span><span class="comment"> * 如果需要极限压缩 userboot 的代码量大小(例如双分区均设在于片内 Flash的场景), 请调整编译优化等级为 Oz-image size</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span><span class="comment"> */</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>    <a class="code hl_function" href="bsp__init_8c.html#ac1d41f544770121f1cb61aeb64e5807e">bsp_init</a>();</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>    </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>    printf(<span class="stringliteral">&quot;\r\n*************************************\r\n&quot;</span>);</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>    printf(<span class="stringliteral">&quot;\r\n LVGL Demo of TFT-LCD_RGB &lt;&lt;SWM34S&gt;&gt; \r\n&quot;</span>);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>    printf(<span class="stringliteral">&quot;\r\n  V%d.%d.%d build-release %d-%d-%d   \r\n&quot;</span>, 7, 9, 0, 2023, 05, 12);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>    printf(<span class="stringliteral">&quot;\r\n   @Copyright by Synwit Technology   \r\n&quot;</span>);</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>    printf(<span class="stringliteral">&quot;\r\n*************************************\r\n&quot;</span>);</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>    </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>    <a class="code hl_function" href="main_8c.html#a001e0ff5f04ad4f86670205d3905c0c5">gui_init</a>();</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>    <a class="code hl_function" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102">user_app</a>();</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>    <span class="keywordflow">for</span> (;;)</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>    {</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>        <span class="comment">/* 要处理 LVGL 的任务, 您需要定期调用 lv_task_handler() (间隔大约为 5ms 左右)</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span><span class="comment">         * 要注意 LVGL 默认不是线程安全的, 一般放于任务队列较低的优先级</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span><span class="comment">         * 在 RTOS 中使用时，应该考虑通过互斥量来建立临界区来避免 lv_task_handler() 与 lv_tick_inc() 产生 竞争冲突</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span><span class="comment">         */</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>        lv_task_handler();</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>    }</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span>    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>}</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="main_8c.html#a4728919288dacba97228c27b1c996108">  111</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="main_8c.html#a4728919288dacba97228c27b1c996108">isr_systick</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>{</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>    <a class="code hl_function" href="dev__systick_8c.html#a3d9798af743e2d9726406d6f847231ec">systick_inc_tick</a>();</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span>    </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span>    lv_tick_inc(1);</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>    </div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>    ++<a class="code hl_variable" href="main_8c.html#a7d9f2d02fb8222f2a32fc7eeeed8e655">Systick_Ms_TP</a>;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>}</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span><span class="comment"> * Private Function</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span><span class="preprocessor">#include &quot;lv_port_disp.h&quot;</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span><span class="preprocessor">#include &quot;lv_port_indev.h&quot;</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span><span class="preprocessor">#include &quot;lv_port_fs.h&quot;</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="main_8c.html#a001e0ff5f04ad4f86670205d3905c0c5">  129</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="main_8c.html#a001e0ff5f04ad4f86670205d3905c0c5">gui_init</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span>{</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>    lv_init();</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span>    lv_port_disp_init();</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>    lv_port_indev_init();</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span>    <span class="comment">// lv_port_fs_init();</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>}</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span> </div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span><span class="preprocessor">#if (WDT_ENABLE != 0)</span></div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span><span class="keyword">static</span> <span class="keywordtype">void</span> wdt_feed_cb(lv_task_t *t)</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span>{</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span>    WDT-&gt;FEED = 0x55;<span class="comment">//WDT_Feed(WDT);</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span>}</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span> </div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span><span class="preprocessor">#if (SLEEP_ENABLE != 0)</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span><span class="keyword">static</span> <span class="keywordtype">void</span> sleep_cb(lv_task_t *t)</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span>{</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span>    <span class="keywordflow">if</span> (<a class="code hl_variable" href="main_8c.html#a7d9f2d02fb8222f2a32fc7eeeed8e655">Systick_Ms_TP</a> &gt;= SLEEP_TIME_MS) <span class="comment">//超过指定时长无触摸交互</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span>    {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>        <a class="code hl_variable" href="main_8c.html#a7d9f2d02fb8222f2a32fc7eeeed8e655">Systick_Ms_TP</a> = 0;</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span> </div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span><span class="preprocessor">#if 1 </span><span class="comment">/* 1-低功耗演示     0-复位演示 */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span> </div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span><span class="preprocessor">    #if (WDT_ENABLE != 0)</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>        WDT_Stop(WDT);</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span><span class="preprocessor">    #endif</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span>        <a class="code hl_function" href="power__manager_8c.html#aa125d952f6750a2c86b46ecfc611b399">pm_request</a>(<a class="code hl_enumvalue" href="power__manager_8h.html#ad68f0f1a7d5e0cc311f261c21716f8c1a7f72cb1eff8d0a943b7029b3e93c4e67">PM_MODE_SLEEP</a>); <span class="comment">/* PM_MODE_STOP */</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span> </div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span><span class="preprocessor">    #if (WDT_ENABLE != 0)</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>        <span class="comment">//WDT_Init(WDT, wdt_int_ms, wdt_rst_ms);</span></div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>        WDT_Feed(WDT);</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>        WDT_Start(WDT);</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span><span class="preprocessor">    #endif</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span> </div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>        NVIC_SystemReset();</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span>        <span class="keywordflow">while</span> (1)</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span>            ; <span class="comment">/* 展会时自动复位以演示 */</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span>    }</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span>}</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span> </div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span><span class="preprocessor">#if ( (1 &lt; __TARGET_CONST__ &amp;&amp; __TARGET_CONST__ &lt; 6) || (7 &lt; __TARGET_CONST__ &amp;&amp; __TARGET_CONST__ &lt; 12) )</span></div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span><span class="preprocessor">#include &quot;<a class="code" href="ui__update_8h.html">ui_update.h</a>&quot;</span></div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span><span class="preprocessor">#include &quot;<a class="code" href="ui__boot_8h.html">ui_boot.h</a>&quot;</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span><span class="preprocessor">#include &quot;<a class="code" href="ui_8h.html">ui.h</a>&quot;</span></div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span> </div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span><span class="keyword">static</span> <span class="keywordtype">void</span> mv_cb(lv_task_t *t)</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno">  202</span>{</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span>    <a class="code hl_function" href="load__mv_8c.html#a4baf0d2c0d6e1fea0ddb9867c9747f8b">mv_task_handler</a>();</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span>}</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span> </div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"><a class="line" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102">  210</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102">user_app</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span>{</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span><span class="preprocessor">#if (__TARGET_CONST__ == 0 || __TARGET_CONST__ == 6)</span></div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span><span class="preprocessor">#include &quot;lv_examples/lv_examples.h&quot;</span></div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>    <span class="comment">/* 注意:下方条件宏存在优先级判断, 须保证同时只能有一个宏生效(置1) */</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span><span class="preprocessor">#if LV_USE_DEMO_WIDGETS </span><span class="comment">// 小部件演示</span></div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>    lv_demo_widgets();</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span> </div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span><span class="preprocessor">#elif LV_USE_DEMO_STRESS </span><span class="comment">// 压力测试(测试内存溢出等缺陷)</span></div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>    lv_demo_stress();</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span><span class="preprocessor">#elif LV_USE_DEMO_BENCHMARK </span><span class="comment">// 帧率评测</span></div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span>    lv_demo_benchmark();</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span> </div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span><span class="preprocessor">#elif LV_USE_DEMO_MUSIC </span><span class="comment">// 音乐播放器</span></div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span>    lv_demo_music();</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span> </div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span><span class="preprocessor">#elif LV_USE_DEMO_PRINTER </span><span class="comment">// 打印机</span></div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span><span class="preprocessor">    #error &quot;Please complete it yourself&quot;</span><span class="comment">//未移植</span></div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span> </div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span><span class="preprocessor">#elif LV_USE_DEMO_KEYPAD_AND_ENCODER </span><span class="comment">// 按键/键盘编码器</span></div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span><span class="preprocessor">    #error &quot;Please complete it yourself&quot;</span><span class="comment">//未移植</span></div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span> </div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span><span class="preprocessor">#elif (__TARGET_CONST__ == 1 || __TARGET_CONST__ == 7)</span></div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span><span class="preprocessor">#include &quot;<a class="code" href="simple__lcd__rgb_8h.html">simple_lcd_rgb.h</a>&quot;</span></div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span>    <a class="code hl_function" href="simple__lcd__rgb_8c.html#a88c8131eba18e87016d6c3651e0468f0">simple_lcd_rgb</a>();</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span> </div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span><span class="preprocessor">#elif ( (1 &lt; __TARGET_CONST__ &amp;&amp; __TARGET_CONST__ &lt; 6) || (7 &lt; __TARGET_CONST__ &amp;&amp; __TARGET_CONST__ &lt; 12) )</span></div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span> </div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span>    uint8_t res = 0;</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span>    res = <a class="code hl_function" href="ui__update_8c.html#aea66c53fcc188fefaa3470555db6aa05">ui_update</a>();</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno">  247</span>    <a class="code hl_define" href="log_8h.html#a378e28bfcb78d17285210d6bbb70a083">LOG_INFO</a>(<span class="stringliteral">&quot;[ui_update] result = [%d]\r\n \r\n&quot;</span>, res);</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno">  248</span>    </div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno">  250</span>    res = <a class="code hl_function" href="ui__boot_8c.html#ad915e3f7b5aab86e375414a5844c500a">ui_boot</a>(); </div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span>    <a class="code hl_define" href="log_8h.html#a378e28bfcb78d17285210d6bbb70a083">LOG_INFO</a>(<span class="stringliteral">&quot;[ui_boot] result = [%d]\r\n \r\n&quot;</span>, res);</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>    <span class="keywordflow">if</span> (res == 0)</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span>    {</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span>        <a class="code hl_function" href="ui_8c.html#a42bb09ef137aaeb1733173f3a88ccc85">ui_init</a>(); </div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span>    }</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span>    </div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span>    lv_task_create(mv_cb, 0, LV_TASK_PRIO_MID, NULL);</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span> </div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span><span class="preprocessor">    #if (SLEEP_ENABLE != 0)</span></div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno">  262</span>    lv_task_create(sleep_cb, 100, LV_TASK_PRIO_MID, NULL);</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno">  263</span><span class="preprocessor">    #endif</span></div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span> </div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno">  265</span><span class="preprocessor">    #if (WDT_ENABLE != 0)</span></div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span>    <span class="keyword">const</span> uint16_t wdt_rst_ms = 1024 * 6;</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span>    WDT_Init(WDT, 0, wdt_rst_ms);<span class="comment">// 2^6 = 64 s</span></div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span>    WDT_Start(WDT);</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno">  274</span>    lv_task_create(wdt_feed_cb, wdt_rst_ms / 2, LV_TASK_PRIO_HIGH, NULL);</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno">  275</span><span class="preprocessor">    #endif</span></div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span> </div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span>}</div>
<div class="ttc" id="absp__init_8c_html_ac1d41f544770121f1cb61aeb64e5807e"><div class="ttname"><a href="bsp__init_8c.html#ac1d41f544770121f1cb61aeb64e5807e">bsp_init</a></div><div class="ttdeci">void bsp_init(void)</div><div class="ttdoc">初始化所有的硬件设备, 该函数配置CPU寄存器和外设的寄存器并初始化一些全局变量(只需要调用一次)</div><div class="ttdef"><b>Definition:</b> <a href="bsp__init_8c_source.html#l00029">bsp_init.c:29</a></div></div>
<div class="ttc" id="absp__init_8h_html"><div class="ttname"><a href="bsp__init_8h.html">bsp_init.h</a></div><div class="ttdoc">板级硬件外设初始化</div></div>
<div class="ttc" id="adev__systick_8c_html_a3d9798af743e2d9726406d6f847231ec"><div class="ttname"><a href="dev__systick_8c.html#a3d9798af743e2d9726406d6f847231ec">systick_inc_tick</a></div><div class="ttdeci">void systick_inc_tick(void)</div><div class="ttdef"><b>Definition:</b> <a href="dev__systick_8c_source.html#l00044">dev_systick.c:44</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a4baf0d2c0d6e1fea0ddb9867c9747f8b"><div class="ttname"><a href="load__mv_8c.html#a4baf0d2c0d6e1fea0ddb9867c9747f8b">mv_task_handler</a></div><div class="ttdeci">int mv_task_handler(void)</div><div class="ttdoc">音视频任务处理</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00211">load_mv.c:211</a></div></div>
<div class="ttc" id="alog_8h_html"><div class="ttname"><a href="log_8h.html">log.h</a></div><div class="ttdoc">日志打印/用户提示(告警)</div></div>
<div class="ttc" id="alog_8h_html_a378e28bfcb78d17285210d6bbb70a083"><div class="ttname"><a href="log_8h.html#a378e28bfcb78d17285210d6bbb70a083">LOG_INFO</a></div><div class="ttdeci">#define LOG_INFO(...)</div><div class="ttdoc">调试日志打印-普通</div><div class="ttdef"><b>Definition:</b> <a href="log_8h_source.html#l00042">log.h:42</a></div></div>
<div class="ttc" id="amain_8c_html_a001e0ff5f04ad4f86670205d3905c0c5"><div class="ttname"><a href="main_8c.html#a001e0ff5f04ad4f86670205d3905c0c5">gui_init</a></div><div class="ttdeci">static void gui_init(void)</div><div class="ttdoc">LVGL Core/Port Init</div><div class="ttdef"><b>Definition:</b> <a href="main_8c_source.html#l00129">main.c:129</a></div></div>
<div class="ttc" id="amain_8c_html_a4728919288dacba97228c27b1c996108"><div class="ttname"><a href="main_8c.html#a4728919288dacba97228c27b1c996108">isr_systick</a></div><div class="ttdeci">void isr_systick(void)</div><div class="ttdoc">Systick ISR Callback</div><div class="ttdef"><b>Definition:</b> <a href="main_8c_source.html#l00111">main.c:111</a></div></div>
<div class="ttc" id="amain_8c_html_a7d9f2d02fb8222f2a32fc7eeeed8e655"><div class="ttname"><a href="main_8c.html#a7d9f2d02fb8222f2a32fc7eeeed8e655">Systick_Ms_TP</a></div><div class="ttdeci">volatile uint32_t Systick_Ms_TP</div><div class="ttdoc">手指触摸释放时长 / ms, 反映屏幕多长时间未被点击, 一旦有新的点击触发, 其值立即清零</div><div class="ttdef"><b>Definition:</b> <a href="main_8c_source.html#l00056">main.c:56</a></div></div>
<div class="ttc" id="amain_8c_html_a840291bc02cba5474a4cb46a9b9566fe"><div class="ttname"><a href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a></div><div class="ttdeci">int main(void)</div><div class="ttdoc">C_Main</div><div class="ttdef"><b>Definition:</b> <a href="main_8c_source.html#l00070">main.c:70</a></div></div>
<div class="ttc" id="amain_8c_html_a8f1efe6291a27ae9b326f0c8a236c102"><div class="ttname"><a href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102">user_app</a></div><div class="ttdeci">static void user_app(void)</div><div class="ttdoc">Go to User App Execute</div><div class="ttdef"><b>Definition:</b> <a href="main_8c_source.html#l00210">main.c:210</a></div></div>
<div class="ttc" id="apower__manager_8c_html_aa125d952f6750a2c86b46ecfc611b399"><div class="ttname"><a href="power__manager_8c.html#aa125d952f6750a2c86b46ecfc611b399">pm_request</a></div><div class="ttdeci">void pm_request(pm_mode_t mode)</div><div class="ttdoc">请求进入某种电源模式</div><div class="ttdef"><b>Definition:</b> <a href="power__manager_8c_source.html#l00067">power_manager.c:67</a></div></div>
<div class="ttc" id="apower__manager_8h_html"><div class="ttname"><a href="power__manager_8h.html">power_manager.h</a></div></div>
<div class="ttc" id="apower__manager_8h_html_ad68f0f1a7d5e0cc311f261c21716f8c1a7f72cb1eff8d0a943b7029b3e93c4e67"><div class="ttname"><a href="power__manager_8h.html#ad68f0f1a7d5e0cc311f261c21716f8c1a7f72cb1eff8d0a943b7029b3e93c4e67">PM_MODE_SLEEP</a></div><div class="ttdeci">@ PM_MODE_SLEEP</div><div class="ttdoc">浅度睡眠模式, 一级低功耗</div><div class="ttdef"><b>Definition:</b> <a href="power__manager_8h_source.html#l00031">power_manager.h:31</a></div></div>
<div class="ttc" id="asimple__lcd__rgb_8c_html_a88c8131eba18e87016d6c3651e0468f0"><div class="ttname"><a href="simple__lcd__rgb_8c.html#a88c8131eba18e87016d6c3651e0468f0">simple_lcd_rgb</a></div><div class="ttdeci">void simple_lcd_rgb(void)</div><div class="ttdoc">Lib / SimpLCD 在 lvgl 下实现, 用于测试三基色显示</div><div class="ttdef"><b>Definition:</b> <a href="simple__lcd__rgb_8c_source.html#l00093">simple_lcd_rgb.c:93</a></div></div>
<div class="ttc" id="asimple__lcd__rgb_8h_html"><div class="ttname"><a href="simple__lcd__rgb_8h.html">simple_lcd_rgb.h</a></div><div class="ttdoc">基于 Lib / SimpLCD 三基色显示例程的 LVGL 实现</div></div>
<div class="ttc" id="aui_8c_html_a42bb09ef137aaeb1733173f3a88ccc85"><div class="ttname"><a href="ui_8c.html#a42bb09ef137aaeb1733173f3a88ccc85">ui_init</a></div><div class="ttdeci">void ui_init(void)</div><div class="ttdoc">UI 初始化</div><div class="ttdef"><b>Definition:</b> <a href="ui_8c_source.html#l00057">ui.c:57</a></div></div>
<div class="ttc" id="aui_8h_html"><div class="ttname"><a href="ui_8h.html">ui.h</a></div><div class="ttdoc">UI 页面布局</div></div>
<div class="ttc" id="aui__boot_8c_html_ad915e3f7b5aab86e375414a5844c500a"><div class="ttname"><a href="ui__boot_8c.html#ad915e3f7b5aab86e375414a5844c500a">ui_boot</a></div><div class="ttdeci">uint8_t ui_boot(void)</div><div class="ttdoc">挂载文件系统以完成本地素材检测, 并将其导入至 SDRAM , 同时实现开机动画/视频效果</div><div class="ttdef"><b>Definition:</b> <a href="ui__boot_8c_source.html#l00049">ui_boot.c:49</a></div></div>
<div class="ttc" id="aui__boot_8h_html"><div class="ttname"><a href="ui__boot_8h.html">ui_boot.h</a></div><div class="ttdoc">开机动画/视频页, 挂载文件系统完成主页素材的导入</div></div>
<div class="ttc" id="aui__update_8c_html_aea66c53fcc188fefaa3470555db6aa05"><div class="ttname"><a href="ui__update_8c.html#aea66c53fcc188fefaa3470555db6aa05">ui_update</a></div><div class="ttdeci">uint8_t ui_update(void)</div><div class="ttdoc">启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新</div><div class="ttdef"><b>Definition:</b> <a href="ui__update_8c_source.html#l00288">ui_update.c:288</a></div></div>
<div class="ttc" id="aui__update_8h_html"><div class="ttname"><a href="ui__update_8h.html">ui_update.h</a></div><div class="ttdoc">启动引导更新页, 挂载文件系统实现 UI 素材导入/更新(可选模块)</div></div>
<div class="ttc" id="auserboot_8c_html_a5d51bf8d3184d1c34b5fde41d69b1559"><div class="ttname"><a href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559">userboot</a></div><div class="ttdeci">void userboot(void)</div><div class="ttdoc">UserBoot 功能</div><div class="ttdef"><b>Definition:</b> <a href="userboot_8c_source.html#l00168">userboot.c:168</a></div></div>
<div class="ttc" id="auserboot_8h_html"><div class="ttname"><a href="userboot_8h.html">userboot.h</a></div><div class="ttdoc">IAP 实现 UserBoot 功能</div></div>
<div class="ttc" id="aversion_8h_html"><div class="ttname"><a href="version_8h.html">version.h</a></div><div class="ttdoc">版本/目标控制</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
